package com.campus.campusdelivery.dto;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

@Data
public class CreateOrderRequest {
    
    @NotNull(message = "商家ID不能为空")
    private Long merchantId;
    
    @NotBlank(message = "配送地址不能为空")
    private String deliveryAddress;
    
    @NotBlank(message = "配送电话不能为空")
    private String deliveryPhone;
    
    @NotBlank(message = "配送姓名不能为空")
    private String deliveryName;
    
    private String remark;
    
    @NotEmpty(message = "订单项不能为空")
    @Valid
    private List<OrderItemRequest> orderItems;
    
    @Data
    public static class OrderItemRequest {
        @NotNull(message = "菜品ID不能为空")
        private Long menuItemId;
        
        @NotNull(message = "数量不能为空")
        private Integer quantity;
        
        private String remark;
    }
}
